import * as React from "react";
import "~/pretty-checkbox/src/pretty-checkbox.scss";
import style from "./index.scss";
export default class extends React.Component {
   render() {
    const { name, value, label, onChange } = this.props;
    return (
      <div className={style.formitem}>
        <div> {this.props.label}</div>
        <div className="pretty p-icon p-smooth">
          <input
            value={this.props.label}
            checked={label === value}
            type="radio"
            name={name}
            onChange={(e) => {
              onChange(e.target.value);
            }}
          />
          <div >
          <i className={`${label === value ? "icon zmdi zmdi-check" : ""}`}></i>
            <label />
          </div>
        </div>
      </div>
    );
  }
}
